package com.calvin.study.strategy.base.concrete;

import com.calvin.study.strategy.base.service.WaimaiService;
import com.calvin.study.strategy.strategy.AbstractStrategy;
import com.calvin.study.strategy.strategy.Strategy;

public class Waimai extends AbstractStrategy implements Strategy {

	// 实例化Waimai
	private static final Waimai instance = new Waimai();

	private WaimaiService waimaiService = new WaimaiService();

	// 实例化时，注册该策略
	private Waimai() {
		register();
	}

	// 1.单例模式，实例化对象
	// Spring 使用 @Component实例化 由容器管理
	public static Waimai getInstance() {
		return instance;
	}

	@Override
	public void issue(Object... params) {
		// 调用WaimaiService
		waimaiService.issueWaimai();
	}

}
